import {IconImg} from '@/components/images'
import {CItem} from '@/components/item'
import {View} from '@tarojs/components'
export const InfoItem: React.FC<{
  label: string
  value: string | JSX.Element
  isLast?: boolean
  onClick?: Function
}> = ({label, value, isLast, onClick}): JSX.Element => {
  return (
    <CItem
      style={{
        height: '136rpx',
        padding: '44rpx 32rpx !important',
        justifyContent: 'space-between',
        backgroundColor: '#fff',
        borderTop: '2rpx solid #f0f0f0',
        borderBottom: isLast ? '2rpx solid #f0f0f0' : ''
      }}
      onClick={() => onClick && onClick()}
    >
      <View className="flex-1 h-full flex justify-between items-center">
        <View className="h-full ml-8 flex items-center text-16">{label}</View>
        <View className="h-full flex-1 mr-10 text-right truncate text-16 text-xx_text">
          {value}
        </View>
      </View>
    </CItem>
  )
}
